package com.mentorgen.tools.util.profile.bundle.obsolete;

import java.util.Collection;
import java.util.Map;


public class BundleMethodBandwidth {
	
	private Map<String, MethodBandwidth> methodOut;
	private MethodBandwidth methodReturn;
	
	public void addOutgoingSize(String _bundle, String _class, String _method, int _outSize){
		
		String methodKey = _bundle + ":" + _class + ":" + _method;
		methodOut.get(methodKey).addDataExchng(0, _outSize);
		
	}
	
	public void addReturnSize(int _returnSize){
		methodReturn.addDataExchng(_returnSize, 0);
	}
	
	public Collection<MethodBandwidth> getMethodContainerCollection(){
		return methodOut.values();
	}
	
	public long totalOut(){
		long totalOut = 0;
		for (String methodKey : methodOut.keySet())
			totalOut += methodOut.get(methodKey).getTotalOutdata();
		return totalOut;
	}
	
	public long totalReturn(){
		return methodReturn.getTotalIndata();
	}
	
	public long avgOut(){
		long avgOut = 0;
		for (String methodKey: methodOut.keySet())
			avgOut += methodOut.get(methodKey).getAvgMthdOutdata();
		return avgOut;
	}
	
	public long avgReturn(){
		return methodReturn.getAvgMthdIndata();
	}

}
